02/05/2022

This Demo

Beginning with RStudio and git

Some R online resources

Where to get R packages

Some demo requirements (1/2)

Please execute the code before continue the presentation

# Install some standard spatial packages from CRAN
if (!require("sf", quietly = TRUE))
  install.packages("sf")
if (!require("terra", quietly = TRUE))
  install.packages("terra")

# package from Bioconductor
if (!require("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install()
BiocManager::install("EBImage")
## Warning: package(s) not installed when version(s) same as current; use `force = TRUE` to
##   re-install: 'EBImage'

Some demo requirements (2/2)

# Install development package from github
if (!require("remotes", quietly = TRUE))
  install.packages("remotes")
# Install the dev version of ReLTER for use new function
if (!require("ReLTER", quietly = TRUE))
  remotes::install_github("ropensci/ReLTER", ref = 'dev__withImprovements')

## ReLTER is specially drafted for the LTER community.
## 
## To contribute to the improvement of this package, join the group of
##     developers (https://github.com/ropensci/ReLTER).
## 
## If you use this package, please cite as:
## 
## Alessandro Oggioni, Micha Silver, Luigi Ranghetti & Paolo Tagliolato.
##     (2021) oggioniale/ReLTER: ReLTER v1.1.0 (1.1.0). Zenodo.
##     https://doi.org/10.5281/zenodo.5576813

Loading packages

After installing, we need to load the packages into this R session.

# Convenient way to load list of packages
pkg_list <- c("sf", "terra", "ReLTER", "tmap")
lapply(pkg_list, require, character.only = TRUE)
## [[1]]
## [1] TRUE
## 
## [[2]]
## [1] TRUE
## 
## [[3]]
## [1] TRUE
## 
## [[4]]
## [1] TRUE

R Spatial